create external table if not exists jms_ods.yl_nwm_mb_details(
     id                                  bigint            comment'主键id'
    ,waybill_no                          string            comment'运单号'
    ,order_source_code                   string            comment'订单来源编码'
    ,input_time                          date              comment'运单录入时间'
    ,delivery_time                       date              comment'运单寄件时间'
    ,cost_update_time                    date              comment'月结账单费用更新时间'
    ,pick_network_id                     bigint            comment'运单寄件网点id'
    ,pick_network_code                   string            comment'运单寄件网点code'
    ,pick_network_name                   string            comment'运单寄件网点名称'
    ,franchisee_code                     string            comment'所属加盟商（寄件加盟商）'
    ,franchisee_name                     string            comment'所属加盟商code（寄件加盟商）'
    ,pick_finance_id                     bigint            comment'所属代理区id（寄件财务中心id）'
    ,pick_finance_code                   string            comment'所属代理区code（寄件财务中心code）'
    ,pick_finance_name                   string            comment'所属代理区名称（寄件财务中心名称）'
    ,sender_province_id                  bigint            comment'寄件人省id'
    ,sender_province_name                string            comment'寄件人省名称'
    ,sender_city_id                      bigint            comment'寄件人市id'
    ,sender_city_name                    string            comment'寄件人市名称'
    ,sender_area_id                      bigint            comment'寄件人区id'
    ,sender_area_name                    string            comment'寄件人区名称'
    ,sender_detailed_address             string            comment'寄件人详细地址'
    ,origin_id                           bigint            comment'始发地id'
    ,origin_code                         string            comment'始发地code'
    ,origin_name                         string            comment'始发地名称'
    ,customer_type                       bigint            comment'客户类型客户所属：1-总部共享,2-代理区共享,3-自有客户'
    ,customer_network_id                 bigint            comment'客户所属网点id'
    ,customer_network_code               string            comment'客户所属网点code'
    ,customer_network_name               string            comment'客户所属网点名称'
    ,collect_staff_code                  string            comment'揽件业务员code'
    ,collect_staff_name                  string            comment'揽件业务员名称'
    ,customer_code                       string            comment'客户编号code'
    ,customer_name                       string            comment'客户编号名称'
    ,collection_package_type             bigint            comment'集包类型,1:网点集包,2:中心集包,3:集散点集包'
    ,is_need_receipt                     bigint            comment'是否需要需要签回单,1是，0否'
    ,total_freight                       decimal(14,2)     comment'应收金额'
    ,freight                             decimal(14,2)     comment'运单运费'
    ,insured_amount                      decimal(14,2)     comment'保价金额'
    ,receipt_fee                         decimal(8,2)      comment'回单费'
    ,surcharge                           decimal(14,2)     comment'附加费'
    ,tax                                 decimal(14,2)     comment'预付运费'
    ,calculate_fee_code                  decimal(22,0)     comment'算费描述code'
    ,calculate_fee_desc                  string            comment'算费描述'
    ,settlement_weight                   decimal(14,2)     comment'结算重量'
    ,package_charge_weight               decimal(14,2)     comment'计费重量'
    ,sign_sms_notify                     bigint            comment'计费重量来源1.订单重量2.收件重量3.入仓重量4.内部计费重量5.集散到件重量6.中心称重重量7.人工修改重量'
    ,goods_type_id                       bigint            comment'物品类型id'
    ,goods_type_code                     string            comment'物品类型code'
    ,goods_type_name                     string            comment'物品类型名称'
    ,express_type_id                     bigint            comment'产品类型id'
    ,express_type_code                   string            comment'产品类型code'
    ,express_type_name                   string            comment'产品类型名称'
    ,receiver_province_id                bigint            comment'收件人省id'
    ,receiver_province_name              string            comment'收件人省名称'
    ,receiver_city_id                    bigint            comment'收件人市id'
    ,receiver_city_name                  string            comment'收件人市名称'
    ,receiver_area_id                    bigint            comment'收件人区id'
    ,receiver_area_name                  string            comment'收件人区名称'
    ,receiver_detailed_address           string            comment'收件人详细地址'
    ,dispatch_finance_id                 bigint            comment'派件财务中心id'
    ,dispatch_finance_code               string            comment'派件财务中心code'
    ,dispatch_finance_name               string            comment'派件财务中心名称'
    ,dispatch_network_id                 bigint            comment'派件网点id'
    ,dispatch_network_code               string            comment'派件网点code'
    ,dispatch_network_name               string            comment'派件网点名称'
    ,sign_network_id                     bigint            comment'签收网点id'
    ,sign_network_code                   string            comment'签收网点code'
    ,sign_network_name                   string            comment'签收网点名称'
    ,is_sign                             bigint            comment'签收标识,1是，0否'
    ,destination_id                      bigint            comment'目的地id'
    ,destination_code                    string            comment'目的地code'
    ,destination_name                    string            comment'目的地名称'
    ,sign_time                           date              comment'签收时间'
    ,settlement_id                       bigint            comment'结算方式id'
    ,settlement_code                     string            comment'结算方式编码'
    ,settlement_name                     string            comment'结算方式名称'
    ,is_refund                           bigint            comment'是否退件,1是，0否'
    ,is_abnormal                         bigint            comment'问题件标识,1是，0否'
    ,is_settlement                       bigint            comment'结算审核标识,1是，0否'
    ,reviewer                            string            comment'审核人'
    ,reviewer_code                       string            comment'审核人code'
    ,is_void                             bigint            comment'是否作废件,1是，0否'
    ,last_update_time                    date              comment'最后更新时间'
    ,last_update_staff_code              string            comment'最后更新人员编码'
    ,last_update_staff_name              string            comment'最后更新人员名称'
    ,remark                              string            comment'备注'
    ,is_push_ncc                         bigint            comment'是否推送ncc（0未推送,1已推送）'
    ,package_number                      bigint            comment'件数,＞1表示子母件，如果业务上不支持子母件，则前端限制不显示，并默认为1'
    ,receiver_name                       string            comment'收件人姓名'
    ,receiver_mobile_phone               string            comment'收件人手机号'
    ,customer_order_id                   string            comment'客户订单编号'
    ,sender_name                         string            comment'寄件人姓名'
    ,exception_code                      string            comment'异常原因编码'
    ,exception_reason                    string            comment'异常原因'
    ,service_code                        string            comment'服务方式code'
    ,service_name                        string            comment'服务方式名称'
    ,customer_staff_name                 string            comment'所属收派员（客户资料的所属收派员）'
    ,customer_staff_code                 string            comment'所属收派员code（客户资料的所属收派员）'
    ,transport_way                       bigint            comment'运输方式(1:公路运输默认公里运输)'
    ,package_length                      decimal(14,2)     comment'包裹总长,单位厘米'
    ,package_wide                        decimal(14,2)     comment'包裹总宽,单位厘米'
    ,package_high                        decimal(14,2)     comment'包裹总高,单位厘米'
    ,package_volume                      decimal(14,2)     comment'包裹体积重,单位千克'
    ,package_total_volume                decimal(14,2)     comment'包裹总体积,单位立方厘米'
    ,package_cost                        decimal(14,2)     comment'包材费'
    ,other_fee                           decimal(14,2)     comment'其他费'
    ,customer_id                         bigint            comment'客户id'
    ,waybill_id                          bigint            comment'运单id'
    ,trace_id                            string            comment'执行版本（乐观锁时间戳）'
    ,quotetype_code                      bigint            comment'报价类型报价标示0:跨省件,1同城件,2同省件'
    ,insured                             bigint            comment'是否需要保价,1是，0否'
    ,expand1                             string            comment'拓展字段1'
    ,expand2                             string            comment'拓展字段2'
    ,expand3                             string            comment'拓展字段3'
    ,expand4                             string            comment'拓展字段4'
    ,expand5                             string            comment'拓展字段5'
    ,expand6                             string            comment'拓展字段6'
    ,expand7                             string            comment'拓展字段7'
    ,expand8                             string            comment'拓展字段8'
    ,expand9                             string            comment'拓展字段9'
    ,expand10                            string            comment'拓展字段10'
    ,data_source                         bigint            comment'数据来源,1人工修改，0系统'
)comment '网点经营-月结账单明细表'
partitioned by (dt string comment '分区日期')
stored as parquet
location '/dw/hive/jms_ods.db/external/yl_nwm_mb_details'
tblproperties (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);
